using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Threading.Tasks;


namespace WebApp.IntegrationTests
{
    [TestClass]
    public class GenericControllerTest
    {
        [TestMethod]
        public async Task GenericController_Test()
        {
            TestServerFixture testServerFixture = new TestServerFixture();

            foreach (string controller in new[] { "Sprocket", "Widget" })
            {
                var response = await testServerFixture.httpClient.GetAsync($"/{controller}");
                response.EnsureSuccessStatusCode();
                var content = await response.Content.ReadAsStringAsync();
                Assert.AreEqual($"Hello from a generic {controller} controller.", content);
            }

        }
    }
}
